package com.loopy.servlet.annotation;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.IOException;

public class DogServlet extends HttpServlet {
    private int getCount=0;
    private int postCount=0;
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("DogServlet 请求方式是GET 请求次数是"+(++getCount)+" POST请求次数是"+postCount);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("DogServlet 请求方式是POST 请求次数是"+(++postCount)+" GET请求次数是"+getCount);
    }
}
